<?php

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;

/**
 * Class Article
 * 
 * @property int $id
 * @property int|null $type
 * @property string|null $title
 * @property string|null $author
 * @property string|null $images
 * @property string|null $description
 * @property string|null $content
 * @property Carbon|null $create_at
 * @property Carbon|null $update_at
 * @property Carbon|null $delete_at
 *
 * @package App\Models
 */
class Article extends BaseModels
{
	protected $table = 'zh_article';


	protected $dates = [
		'create_at',
		'update_at',
		'delete_at'
	];

	protected $fillable = [
		'type',
		'title',
		'author',
        'images',
		'description',
		'content',
		'create_at',
		'update_at',
		'delete_at'
	];

	protected $appends = [
	    'type_name'
    ];


	public function getTypeNameAttribute()
    {
        switch ($this->type){
            case 1:
                return '商城简介';
            default:
                return '未知';
        }
    }
}
